home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / The World of Computer Software.iso / xfeel.zip / XFEEL2.C < prev   
Text File  |  1992-12-18  |  3KB  |  99 lines

  1. /*-------------------------------------------------------------------------*/
  2. /*                                                                         */
  3. /*   XFEEL2.C   : Compile this Module to XFEEL.DLL and place it in the     */
  4. /*                LIBPATH.                                                 */
  5. /*                                                                         */
  6. /*   Version    : V1.00                                                    */
  7. /*                                                                         */
  8. /*   Date       : 31.07.92                                                 */
  9. /*                                                                         */
  10. /*   Copyright  : Roman Fischer Markus Hof                                 */
  11. /*                                                                         */
  12. /*    History:
  13.     
  14.     28.10.92    MH    Entfernen von Shared Segment
  15.     11.11.92 MH Spezialbehandlung fuer verschieden Windowklassen
  16. */
  17. /*-------------------------------------------------------------------------*/
  18.  
  19. #define INCL_DOSPROCESS
  20. #define INCL_WININPUT
  21. #define INCL_WINWINDOWMGR
  22. #define INCL_WINFRAMEMGR
  23. #define INCL_DOSMEMMGR
  24.  
  25. #include <os2pm.h>
  26. #include <stdio.h>
  27.  
  28. BOOL PASCAL XFUNC (HAB hab, PQMSG qmsg, USHORT msgf)
  29.     {
  30.     HWND        active;
  31.     HWND        w, wo;
  32.     HWND        parent, desktop;
  33.     char        classname[31];
  34.  
  35.  
  36.     /*-------------------------------------------------------------*/
  37.     /* Wenn Maus gecaptured tue ich nichts                         */
  38.     
  39.     if (WinQueryCapture (HWND_DESKTOP, FALSE))
  40.         return (FALSE);
  41.  
  42.  
  43.     /*-------------------------------------------------------------*/
  44.     /* Ich behandle nur Nachrichten ueber Mausbewegungen           */
  45.  
  46.     if (qmsg->msg != WM_MOUSEMOVE)
  47.         return (FALSE);
  48.         
  49.     /*-------------------------------------------------------------*/
  50.     /* Hole aktives Fenster. Breche ab, falls das aktive Fenster   */
  51.     /* ein Frame ist und der Titel 'Window List' ist. In diesem    */
  52.     /* Fall Ist die Tasklist aktiv, bei welcher ich nichts aendere.*/
  53.     
  54.     active    =    WinQueryActiveWindow (HWND_DESKTOP, FALSE);
  55.     WinQueryClassName (active, 30, (PCH)classname);
  56.     if (classname[1]=='1')
  57.         {
  58.         WinQueryWindowText (active, 30, (PCH)classname);
  59.         if (!strcmp (classname, "Window List"))
  60.             return (FALSE);
  61.         }
  62.  
  63.     /*-------------------------------------------------------------*/
  64.     /* Hole Informationen ueber das neue Fenster.                  */
  65.  
  66.     desktop    =    WinQueryDesktopWindow (hab, NULL);
  67.     wo = w    =    qmsg->hwnd;
  68.     parent    =    WinQueryWindow (w, QW_PARENT, FALSE);
  69.     while (parent != desktop)
  70.         {
  71.         wo = w;
  72.         w = parent;
  73.         parent = WinQueryWindow (w, QW_PARENT, FALSE);
  74.         }
  75.  
  76.  
  77.     /*-------------------------------------------------------------*/
  78.     /* Wenn neues Window der Desktop ist, breche ab                */
  79.  
  80.     WinQueryWindowText (w, 30, (PCH)classname);
  81.     if (!strcmp (classname, "OS/2 2.0 Desktop"))
  82.         return (FALSE);
  83.  
  84.     /*-------------------------------------------------------------*/
  85.     /* Falls neues ein Menu ist brich ab                           */
  86.  
  87.     WinQueryClassName (wo, 30, (PCH)classname);
  88.     if (!strcmp (classname, "#4"))
  89.         return (FALSE);
  90.  
  91.     /*-------------------------------------------------------------*/
  92.     /* Mache neues aktiv, wenn es nicht schon aktiv ist.           */
  93.  
  94.     if (w!=active)
  95.         WinSetFocus (HWND_DESKTOP, qmsg->hwnd);
  96.  
  97.     return (FALSE);
  98.     }
  99.